package com.yanlight.app.request;

import java.util.SortedMap;
import java.util.TreeMap;

/**
 * https://pay.weixin.qq.com/wiki/doc/api/tools/sp_coupon.php?chapter=12_3&index=4
 */
public class WxCouponRequest {

    //代金券批次id
    private String coupon_stock_id;

    //openid记录数  固定值
    private String openid_count = "1";

    //商户单据号
    private String partner_trade_no;

    //用户openid
    private String openid;

    //公众账号ID
    private String appid;

    //商户号
    private String mch_id;

//    //操作员 非必要字段
//    private String op_user_id;
//
//    //设备号 非必要字段
//    private String device_info;

    //随机字符串
    private String nonce_str;

    private String sign;

    //固定值  非必要字段
    private String version = "1.0";

    //固定值  非必要字段
    private String type = "XML";

    public SortedMap<String, String> setupParams() {
        SortedMap<String, String> paramsMap = new TreeMap<>();
        paramsMap.put("coupon_stock_id", getCoupon_stock_id());
        paramsMap.put("openid_count", getOpenid_count());
        paramsMap.put("partner_trade_no", getPartner_trade_no());
        paramsMap.put("openid", getOpenid());
        paramsMap.put("appid", getAppid());
        paramsMap.put("mch_id", getMch_id());
        paramsMap.put("nonce_str", getNonce_str());
        paramsMap.put("version", getVersion());
        paramsMap.put("type", getType());

        return paramsMap;
    }

    public String getCoupon_stock_id() {
        return coupon_stock_id;
    }

    public void setCoupon_stock_id(String coupon_stock_id) {
        this.coupon_stock_id = coupon_stock_id;
    }

    public String getOpenid_count() {
        return openid_count;
    }

    public void setOpenid_count(String openid_count) {
        this.openid_count = openid_count;
    }

    public String getPartner_trade_no() {
        return partner_trade_no;
    }

    public void setPartner_trade_no(String partner_trade_no) {
        this.partner_trade_no = partner_trade_no;
    }

    public String getOpenid() {
        return openid;
    }

    public void setOpenid(String openid) {
        this.openid = openid;
    }

    public String getAppid() {
        return appid;
    }

    public void setAppid(String appid) {
        this.appid = appid;
    }

    public String getMch_id() {
        return mch_id;
    }

    public void setMch_id(String mch_id) {
        this.mch_id = mch_id;
    }

//    public String getOp_user_id() {
//        return op_user_id;
//    }
//
//    public void setOp_user_id(String op_user_id) {
//        this.op_user_id = op_user_id;
//    }
//
//    public String getDevice_info() {
//        return device_info;
//    }
//
//    public void setDevice_info(String device_info) {
//        this.device_info = device_info;
//    }

    public String getNonce_str() {
        return nonce_str;
    }

    public void setNonce_str(String nonce_str) {
        this.nonce_str = nonce_str;
    }

    public String getSign() {
        return sign;
    }

    public void setSign(String sign) {
        this.sign = sign;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }
}
